function getElem(id) {
	if (!this.objCache) this.objCache = {};
	if (!this.objCache[id]) this.objCache[id] = document.getElementById(id);

	return this.objCache[id]
}

function showElem(id) { getElem(id).style.display = 'block'; }
function hideElem(id) { getElem(id).style.display = 'none'; }
function focusElem(id) { getElem(id).focus(); }

function swithElem(id) {
	var elem = getElem(id);
	elem.style.display = (elem.style.display == 'none') ?
		elem.style.display = 'none' :
		elem.style.display = 'block';
}

function showAll(arr) {
	for (var i in arr)
		getElem(arr[i]).style.display = 'block';
}

function hideAll(arr) {
	for (var i in arr)
		getElem(arr[i]).style.display = 'none';
}

function selectAllByClass(arrElems, className) {
	var ret = [], arrClasses, elem;
	for (var i in arrElems) {
		elem = arrElems[i];
		if (!elem.className) continue;
		arrClasses = elem.className.split(' ');
		if (arrClasses.inArray(className)) ret.push(elem);
	}
	return ret;
}